/**
 * ===========================================================================
 * 版权所有 湖南免了么网络科技有限公司，并保留所有权利。
 * 网站地址: http://www.mianle.me
 * ===========================================================================
 * 9:13 2018/6/7
 */
package com.mianle.userapi.controller;

import com.mianle.userapi.service.GaodeService;
import com.mianle.userapi.util.JsonResponseData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CachePut;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @Author: yiyuan
 * @Description:
 * @Date: Created in 9:13 2018/6/7
 *
 */
@RestController
@RequestMapping(value = "cache")
public class CacheController {

    @Autowired
    private GaodeService gaodeService;

    @Cacheable("coor")
    @GetMapping("spatial")
    public JsonResponseData getSpatialMarker() {
        return gaodeService.getAlls();
    }

    @CachePut("coor")
    @GetMapping("save")
    public int save() {
        return gaodeService.save();
    }


}
